import VueRouter from 'vue-router'
import routes from './routes'
import store from 'src/store'

const router = new VueRouter({
  // mode: 'history',
  routes
})

router.beforeEach((to, from, next) => {
  const { name, meta } = to
  store.commit('SET_ROUTEINFO', { name, meta })
  next()
})

export default router
